package cn.training.service;

import java.util.List;

import jp.terasoluna.fw.dao.QueryDAO;
import jp.terasoluna.fw.dao.UpdateDAO;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.training.bean.UserBean;

@Service
public class HelloWorldService {

	@Autowired
	QueryDAO queryDao;

	@Autowired
	UpdateDAO updateDao;

	
	public List<UserBean> searchUser(UserBean frm) {
		List<UserBean> result= queryDao.executeForObjectList("user.selectuser", frm);
		//frm.setUserId("test");
		
		return result;
	}
	
	public int insert(UserBean frm){
		return updateDao.execute("user.insertuser", frm);		
		
	}
	public int updateUser(UserBean frm){
		return updateDao.execute("user.updateuser", frm);		
		
	}
	public int deleteUser(UserBean frm){
		return updateDao.execute("user.deleteUser", frm);		
		
	}
}
